package learnjava.basic.other;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Properties;

public class TestProperties {
    public static void main(String[] args) throws Exception {

        //Properties读
//        Properties properties = new Properties();
//        properties.load(new FileReader("E:\\java_workspace\\foroffer\\src\\mysql.properties"));
//        properties.list(System.out);
//        System.out.println(properties.getProperty("password"));

        //Properties写，//如果有key就是修改
        Properties properties1 = new Properties();
//        properties1.setProperty("charset","utf8");
        properties1.setProperty("user","帮的");
        properties1.store(new FileWriter("src\\mysql2.properties"),null);


    }
}
